
package com.kweative.lingua.server.structures;

import java.util.List;
import java.util.Set;
import java.util.Stack;

/**
 *
 * @author henrik
 */
abstract public class Pool<T> implements IPool {
    private List<T> pool;

    public Pool() {
        pool = new Stack<T>();
    }
    public void add(T entry) {
        pool.add(entry);
    }
    public void push(T entry) {
        pool.add(entry);
    }
    public T pop() {
        return pool.remove(Math.max(0,size()-1));
    }
    public List<T> getPool() {
        return pool;
    }
    public int size() {
        return pool.size();
    }
}
